/**
 * @Author：ming
 * @Date：2023/10/4 8:34 PM
 * @Filename：Lc11
 */

/**
 * @author ming
 */
public class Lc11 {
    public int maxArea(int[] height) {
        int l = 0;
        int r =height.length-1;
        int max = 0;
        int v = 0;
        while (l<r){
            v = Math.min(height[l],height[r])*(r-l);
            if(v>max){
                max =v;
            }
            if(height[l]>height[r]){
                r--;
            }else {
                l++;
            }

        }
        return max;
    }
}
